package com.fzy.designpattern.observer.custom;

public class ObserverImpl implements Observer {

    private String name;

    private int state;

    public ObserverImpl(String name) {
        this.name = name;
    }

    /**
     * 当主题状态改变时，更新通知
     *
     * @param state
     * @return
     * @author 冯赵杨
     * @create 2018/9/12
     */
    @Override
    public void update(int state) {
        this.state = state;
        System.out.println("状态更新：" + state);
    }
}
